/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package com.cxhd.lis.model.newmodel;

import com.jfinal.core.Controller;
import com.jfinal.plugin.activerecord.Db;
import com.jfinal.plugin.activerecord.Model;

/**
 *
 * @author cxhd
 */
@SuppressWarnings("serial")
public class ZkMajor extends Model<ZkMajor>{
    public final static ZkMajor zkMajorDao=new ZkMajor();
    
    public void deleteMajor(String PK){
        Db.use("mysql").update("delete from zk_major where PK="+Integer.valueOf(PK));
    }
    //select  PK,MAJORNAME from  zk_major
     public void saveZkMajor(Controller con){
         set("MAJORNAME",con.getPara("MAJORNAME"))
                 .save();
     }
     public void updateZkMajor(Controller con){
         findById(Integer.valueOf(con.getPara("PK")))
                  .set("MAJORNAME",con.getPara("MAJORNAME"))
                 .update();
     }
}
